<template>
    <a-select show-search :filter-option="filterOption" placeholder="成果级别" v-model:value="valueId" style="width: 250px"
        :options="dicts"></a-select>
</template>
<script setup>
import { queryList } from '../../../../api/nepu_achievement_dict';
const emit = defineEmits(['update:value']);
const props = defineProps({
    value: {
        type: Object
    }
})

const dicts = ref([])
const valueId = computed({
    get: () => props.value,
    set: (val) => {
        console.log('修改'+val)
        emit('update:value', val)
    }
});
const filterOption = (input, option) => {
    return option.label.indexOf(input.toLowerCase()) >= 0;
};
queryList({
    pageSize: 500,
    pageNum: 1
}).then(res => {
    console.log(res)
    let tarr = res.content
    tarr = tarr.map(ele => {
        ele.label = ele.achievementType
        ele.value = ele.id
        return ele
    })
    dicts.value = tarr
})
// const typeOptions = computed(() => {
//     let arr = $.freeStore(jobStore.types);
//     arr.map(ele => {
//         ele.label = ele.jobTypeName,
//             ele.value = ele.id
//     })
//     return arr
// })
</script>